local BuffImmediately = import(".BuffImmediately")
local BuffFakeAttr = class("BuffFakeAttr", BuffImmediately)

function BuffFakeAttr:ctor(entity, whoEntity, config)
    BuffFakeAttr.super.ctor(self, entity, whoEntity, config)
end

function BuffFakeAttr:_trigger()
    if self._params.typeOpt == "add" then
        self._entity:addFakeAttr(self._params.attrId, self._params.value)
    else
        self._entity:addFakeAttr(self._params.attrId, -self._params.value)
    end
end

function BuffFakeAttr:onDestroy()
    if self._params.typeOpt == "add" then
        self._entity:addFakeAttr(self._params.attrId, -self._params.value)
    else
        self._entity:addFakeAttr(self._params.attrId, self._params.value)
    end
end

return BuffFakeAttr
